#include <stdio.h>

typedef struct student{
    char name[20];
    int id;
    int score[3];
    double average;
}student;

void main(){
    student students[10];
    int sum[3]={0,0,0};
    for (int i=0;i<10;i++){
        scanf("%d %s %d %d %d",&students[i].id,&students[i].name,&students[i].score[0],&students[i].score[1],&students[i].score[2]);
        students[i].average=(double)(students[i].score[0]+students[i].score[1]+students[i].score[2])/3.0;
        for (int j=0;j<3;j++){
            sum[j]+=students[i].score[j];
        }
        ///printf("%d",students[i].id);
    }
    int count=0;
    for (int i=1;i<10;i++){
        if (students[i].average>students[count].average){
            count=i;
        }
    }
    printf("%.2lf %.2lf %.2lf \n",sum[0]/10.0,sum[1]/10.0,sum[2]/10.0);
    printf("%d %s %d %d %d\n",students[count].id,students[count].name,students[count].score[0],students[count].score[1],students[count].score[2]);
}